<?php require_once WEB_ROOT_FOLDER.'views/header.php';?>
<?php
if(isset($_SESSION['username']) && isset($_SESSION['access_level']) && ($_SESSION['access_level'] > 0)){
    ?>
<fieldset class="col_12 column">
    <legend class="col_12 column">Zarządzaj zdjęciami, dodawaj, edytuj opisy oraz usuwaj.</legend>
    <h4>Zarządzaj Twoimi zdjęciami</h4>
    <?php
    if(isset($data['page']['content']) && is_array($data['page']['content'])){
        ?>
    <table class="tight" cellspacing="0" cellpadding="0">
        <thead>
            <tr class="alt first last">
                <th value="image" rel="0" class="col_6 column">Zdjęcie</th>
                <th value="description" rel="1" class="col_4 column">Opis</th>
                <th value="actions" rel="2" class="col_2 column">Dostępne akcje</th>
            </tr>
        </thead>
        <tbody>
            <?php
            if(isset($data['page']['content']['0']['0']) && isset($data['page']['content']['0']['1'])){
                ?>
            
            <tr class="">
                <?php
                if(isset($data['page']['content']['0']['0'])){
                    ?>
                <td class="col_6 column" value="<?php echo $data['page']['content']['0']['0'];?>">
                    <div class="gallery col_12 column">
                        <a href="<?php echo SITE_ROOT;?>upload/<?php echo $data['page']['content']['0']['0'];?>" title="<?php echo $data['page']['content']['0']['1'];?>">
                            <img src="<?php echo SITE_ROOT;?>upload/<?php echo $data['page']['content']['0']['0'];?>" alt="<?php echo $data['page']['content']['0']['1'];?>" width="100" heigh="100">
                        </a>
                    </div>
                </td>  
                <?php
                }
                ?>
                <?php
                if(isset($data['page']['content']['0']['1'])){
                    ?>
                <td class="col_4 column" value="<?php echo $data['page']['content']['0']['1'];?>"><?php echo $data['page']['content']['0']['1'];?></td>
                <?php
                }
                ?>
                <?php
                if(isset($data['page']['content']['0']['0']) && isset($data['page']['content']['0']['1'])){
                    ?>
                <td class="col_2 column" value="">
                    <a href="<?php echo WEB_ROOT_FOLDER;?>zdjecia-uzytkownika/edytuj-zdjecie/<?php echo $data['page']['content']['0']['2'];?>.html" title="<?php echo $data['page']['content']['0']['1'];?>">
                        <i class="icon-pencil"></i>
                    </a>
                    <a href="<?php echo WEB_ROOT_FOLDER;?>zdjecia-uzytkownika/usun-zdjecie/<?php echo $data['page']['content']['0']['2'];?>.html" title="<?php echo $data['page']['content']['0']['1'];?>">
                        <i class="icon-minus-sign"></i>
                    </a>
                </td>  
                <?php
                }
                ?>
            </tr>
            <?php
            }
            ?>
        </tbody>
    </table>
    <?php
    }
    ?>
    <p><a href="<?php echo SITE_ROOT;?>zdjecia-uzytkownika/dodaj-zdjecie.html" title="zarzadzaj-zdjeciami">Dodaj nowe zdjęcie</a></p>
</fieldset>
<?php
}
?>
<?php require_once WEB_ROOT_FOLDER.'views/footer.php';?>

